package com.zr.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Orders {

    /**订单状态 - 未付款*/
    public static final Integer STATUS_UNPAY = 1;
    /**订单状态 - 已付款*/
    public static final Integer STATUS_PAYED = 2;
    /**订单状态 - 配送中*/
    public static final Integer STATUS_SEND = 3;
    /**订单状态 - 已完成*/
    public static final Integer STATUS_FINISH = 4;

    private Integer oid;//订单id
    private Date order;//下单时间
    private Date payment;//付款时间
    private Date delivery;//完成时间
    private Integer state;//状态 1未付款 2已付款 3配送中 4已完成
    private ShoppingCart shoppingCart;//购物车对象

//    @Override
//    public String toString() {
//            StringBuffer sb = new StringBuffer("--------------\n");
//            sb.append("订单id："+oid+"\n" +
//                    "下单时间："+order+"\n" +
//                    "付款时间："+payment+"\n" +
//                    "完成时间："+delivery+"\n" +
//                    "状态: "+state+"\n" +
//                    "购物车状态: "+shoppingCart.getState()+"\n" +
//                    "商品名称: "+shoppingCart.getGoods().getGname()+"\n"+
//                    "买家:" +shoppingCart.getUser().getUname());
//            sb.append("--------------\n");
//            return sb.toString();
//    }
}
